package com.oocl.service.impl;

import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.oocl.dao.CustomerDao;
import com.oocl.pojo.Customer;
import com.oocl.service.CustomerManager;

@Service("customerManager")
public class CustomerManagerImplDi implements CustomerManager{
	@Resource(name="customerDao")
	private CustomerDao customerDao;
	
	@Override
	public Customer addCustomer(Customer customer) {
		customer.setId(UUID.randomUUID().toString());
		return customerDao.addCustomer(customer);
	}

	@Override
	public Customer updateCustomer(Customer customer) {
		return customerDao.updateCustomer(customer);
	}

	@Override
	public Customer deleteCustomerById(String id) {
		return customerDao.deleteCustomerById(id);
	}

	@Override
	public List<Customer> findAll() {
		return customerDao.findAll();
	}

	@Override
	public Customer findCustomerById(String id) {
		return customerDao.findCustomerById(id);
	}
	
}
